-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage/linstor): Enhance multi-disk support and provisioning flexibility in Linstor SR tests #270
base: master
Are you sure you want to change the base?
feat(storage/linstor): Enhance multi-disk support and provisioning flexibility in Linstor SR tests #270
Conversation
Adding a new CLI parameter such as Couldn't we have test definitions that do both |
We can do that. Since this is XOSTOR level, one full cycle (create-test-destroy) with Can we retain the CLI option for those callers who want to selectively run in one of the mode? |
In theory pytest already offers enough selectors to execute a set of tests and not others. |
eb87c3d
to
c5369b7
Compare
989afea
to
5b0e1b7
Compare
"thick": "xcp-sr-linstor_group_device", | ||
"thin": "xcp-sr-linstor_group_thin_device" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use conftest.py here, we already have these helpers:
xcp-ng-tests/tests/storage/linstor/conftest.py
Lines 9 to 10 in 134fd55
GROUP_NAME = 'linstor_group' | |
STORAGE_POOL_NAME = f'{GROUP_NAME}/thin_device' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also xcp-sr-linstor_group_device
is not valid, it's just xcp-sr-linstor_group_device
for thick provisioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, using GROUP_NAME
is better.
'redundancy': '1', | ||
'provisioning': 'thin' | ||
'group-name': storage_pool_name, | ||
'redundancy': '2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here.
'redundancy': '1', | ||
'provisioning': 'thin' | ||
'group-name': storage_pool_name, | ||
'redundancy': '2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to set 2 in your tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a strange issue with thick
SR and redundancy
set as 1
. The error looks like below upon trying to create a VM (VDI). So, keeping it as 2
for now, so that other tests on thick
SR can pass.
***** LINSTOR resources on XCP-ng: EXCEPTION <class 'xs_errors.SROSError'>, VDI Creation failed [opterr=error cmd: `['/usr/bin/vhd-util', 'create', '--debug', '-n', '/dev/drbd/by-res/xcp-volume-d21c6a82-ed29-4106-ace6-7542c334254c/0', '-s', '2048', '-S', '2097152']`, code: `30`, reason: `/dev/drbd/by-res/xcp-volume-d21c6a82-ed29-4106-ace6-7542c334254c/0: failed to create: -30` (openers: {'xcp-ng-xs1': {}})]
Feb 18 19:02:59 xcp-ng-xs1 SM: [46577] File "/opt/xensource/sm/LinstorSR", line 1743, in create
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we must handle this error in the driver itself. In theory a simple busy loop should fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will keep it as 1
.
conftest.py
Outdated
assert len(disks) > 0, "This test requires at least one --sr-disk parameter" | ||
# Fetch available disks on the master host | ||
master_disks = host.available_disks() | ||
assert len(master_disks) > 0, "a free disk device is required on the master host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe A
instead of a
to uniformize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
tests/storage/linstor/conftest.py
Outdated
@@ -12,57 +12,85 @@ | |||
LINSTOR_PACKAGE = 'xcp-ng-linstor' | |||
|
|||
@pytest.fixture(scope='package') | |||
def lvm_disk(host, sr_disk_for_all_hosts): | |||
device = '/dev/' + sr_disk_for_all_hosts | |||
def lvm_disk(host, sr_disks_for_all_hosts, provisioning_type): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe lvm_disks
if you change the logic here. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :)
5b0e1b7
to
bb5047e
Compare
…exibility in Linstor SR tests - Added `sr_disks_for_all_hosts` fixture to support multiple disks, ensuring availability across all hosts and handling "auto" selection dynamically. - Updated `lvm_disks` (`lvm_disk`) fixture to provision multiple disks collectively, refining vgcreate and pvcreate logic. - Introduced `provisioning_type` and `storage_pool_name` fixtures to dynamically configure storage provisioning (thin or thick). - Refactored Linstor SR test cases to use the new fixtures, improving test coverage across provisioning types. - Optimized Linstor installation and cleanup using concurrent execution, reducing setup time. - Enhanced validation and logging for disk selection. Signed-off-by: Rushikesh Jadhav <[email protected]>
bb5047e
to
710279c
Compare
sr_disks_for_all_hosts
fixture to support multiple disks, ensuring availability across all hosts and handling "auto" selection dynamically.lvm_disk
fixture to provision multiple disks collectively, refining vgcreate and pvcreate logic.provisioning_type
andstorage_pool_name
fixtures to dynamically configure storage provisioning (thin or thick).